<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ace="http://www.icefaces.org/icefaces/components"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	xmlns:icecore="http://www.icefaces.org/icefaces/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">


	<ui:composition template="../WEB-INF/templates/template.xhtml">

		<ui:param name="title" value="Fact Entry System" />

		<ui:define name="header">
			<ui:include src="../WEB-INF/templates/header.xhtml" />
		</ui:define>

		<ui:define name="menu">
			<ui:include src="../WEB-INF/templates/menuLeft.xhtml" />
		</ui:define>

		<ui:define name="content">
			<icecore:singleSubmit submitOnBlur="true" />
			<h:outputLabel value="Fact Entry Master Data Management"
				style="font-weight: bold;font-size: 15px;" />
			<br />
			<br />



			<ace:dataTable id="factMstTable" value="#{factMstBean.factData}"
				var="fact">

				<ace:column id="name" headerText="Name"
					styleClass="columnAlignCenter">
					
					<ace:cellEditor>
					<h:inputHidden value="#{fact.factId}" />
						<f:facet name="output">
							<h:outputText value="#{fact.factName}" />

						</f:facet>
						<f:facet name="input">
							<h:inputText value="#{fact.factName}" />
						</f:facet>
					</ace:cellEditor>
					
				</ace:column>
				<ace:column id="valueFrom" headerText="Value From"
					styleClass="columnAlignLeft">
					
					<ace:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{fact.valueFrom}" />

						</f:facet>
						<f:facet name="input">
							<h:inputText value="#{fact.valueFrom}" style="width: 50px;" />
						</f:facet>
					</ace:cellEditor>
					
				</ace:column>
				<ace:column id="valueTo" headerText="Value To"
					styleClass="columnAlignLeft">
					<ace:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{fact.valueTo}" />

						</f:facet>
						<f:facet name="input">
							<h:inputText value="#{fact.valueTo}" style="width: 50px;" />
						</f:facet>
					</ace:cellEditor>
					
				</ace:column>

				<ace:column id="alignment" headerText="Alignment"
					styleClass="columnAlignLeft">
				
					<ace:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{fact.alignment}" />

						</f:facet>
						<f:facet name="input">
							<h:inputText value="#{fact.alignment}" style="width: 100px;"/>
						</f:facet>
					</ace:cellEditor>
					
				</ace:column>

				<ace:column id="validatoinText" headerText="Validation Text"
					styleClass="columnAlignLeft">
					
					<ace:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{fact.validationText}" />
						</f:facet>
						<f:facet name="input">
							<h:inputText value="#{fact.validationText}"  style="width: 200px;"/>
						</f:facet>
					</ace:cellEditor>
					
				</ace:column>

				<ace:column id="active" headerText="Active ?"
					styleClass="columnAlignLeft">
					
					<ace:cellEditor>
						<f:facet name="output">
							<h:outputText value="Yes" rendered="#{fact.isActive == '1'}" />
							<h:outputText value="No" rendered="#{fact.isActive == '0'}" />

						</f:facet>
						<f:facet name="input">
							<h:selectOneRadio value="#{fact.isActive}">
								<f:selectItem itemValue="1" itemLabel="Yes" />
								<f:selectItem itemValue="0" itemLabel="No" />
							</h:selectOneRadio>
						</f:facet>
					</ace:cellEditor>
					
				</ace:column>

				<ace:column id="mandatory" headerText="Mandatory ?"
					styleClass="columnAlignLeft">

					<ace:cellEditor>
						<f:facet name="output">
							<h:outputText value="Yes" rendered="#{fact.isMandatory == '1'}" />
							<h:outputText value="No" rendered="#{fact.isMandatory == '0'}" />

						</f:facet>
						<f:facet name="input">
							<h:selectOneRadio value="#{fact.isMandatory}">
								<f:selectItem itemValue="1" itemLabel="Yes" />
								<f:selectItem itemValue="0" itemLabel="No" />
							</h:selectOneRadio>
						</f:facet>
					</ace:cellEditor>

				</ace:column>



				<ace:column headerText="Edit" id="ssdd">
					<ace:rowEditor startTitle="Edit" id="editBtn" submitTitle="Edit It"	cancelTitle="Cancel it" rowEditListener="#{factMstBean.editFact}" />
				</ace:column>
				
				<ace:column headerText="Delete" >
					
				</ace:column>
			</ace:dataTable>


		</ui:define>

		<ui:define name="footer">
			<ui:include src="../WEB-INF/templates/footer.xhtml" />
		</ui:define>

	</ui:composition>

</html>